<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ page isELIgnored="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="<s:url value="/resources"/>/css/style_new.css" rel="stylesheet" type="text/css" />
    <link href="<s:url value="/resources"/>/css/main_new.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/cupertino/jquery-ui.min.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/ui.jqgrid.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/ui.multiselect.css" />
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-ui.custom.min.js"></script> 
	<script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.form.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/json2.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/messages_zh.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/grid.locale-cn.js"></script>    
    <script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.jqGrid.min.js"></script>
 <script type="text/javascript">  
    $(function(){ 
		    loadTab();
		 });
	 
	 //加载表单
	 function loadTab(){  
		    $("#myTab").jqGrid({      
		    url:'<s:url value="/cxtj"/>/findJysGrid',   
		    datatype: 'json',
		    mtype: 'post',         
		   	colNames:['交易商名称','行业类型','所属地区'],
		   	colModel:[
			   	{name:'qiyqc',index:'qiyqc', width:250}, 
			   	{name:'hangyname',index:'hangyname', width:250},  
			   	{name:'fullsuosdq',index:'fullsuosdq', width:250}			
		   	],	
		   	jsonReader: {
		           repeatitems : false, 
		           id: 'sysid'
		         }, 
		   	rowNum:15,
		   	rowList:[15,30],     	
		   	pager: '#pager13',
		   	rownumbers: true,   	 
		    viewrecords: true,
		    sortname :'sysid',
		    sortorder: 'desc',
            // altRows:true,
            shrinkToFit:true,
            caption: "交易商信息",
		    loadError: function (r, st, error) {
		         $("#message").html("status is " + r.status+error+st);
		         }
		  });
		  $("#myTab").jqGrid('setGridHeight','380px');
		  }
		  
		 //加载市信息
	     function changForCity(value){ 
	          $.getJSON("<s:url value="/cxtj"/>/changForCity", {province:value}, function(data){
	                  //console.log(data[0]);
	                  // var ret = eval('(' + data[0] + ')'); 
	                  //console.log(ret);
	                  //alert(data[1].regionname); 
	                   $("#city").empty();
	                   $("#city").append("<option value='-1' selected>==请选择==</option>");
			          for(var i=0;i<data.length;i++){
				        sObj = data[i];
				        $("#city").append("<option value='"+sObj.regioncode+"'>"+sObj.regionname+"</option>");
			           } 
	           }); 
	        }
	 
		// 查询
		function search(){ 
		  var formdata = $("#form1").serialize(); 
		  $("#myTab").jqGrid('setGridParam',{   
		                          url:'<s:url value="/cxtj"/>/findJysGrid?'+formdata,
								  mtype:'post',
								  page:1}).trigger("reloadGrid");  
		}
		
		//excel
		function exportexcel(){ 
		  var formdata = $("#form1").serialize(); 
		  window.location.href("<s:url value="/cxtj"/>/excelForJiaoys?"+formdata);
		
		}
</script>  

</head>
<body>  
<div class="container">
 <div class="containerbox">
 <div class="search mt10" id="list_search">
<form id="form1" method="post">
<table  class="search-table"  style="width:90%"  cellpadding="0" cellspacing="0" border="0"> 
        <tr>
        	<td >交易商名称:</td>
            <td>
            	<input type="text"  class="form-textbox" style="width: 200px;"  name="aa" /> 
            </td>
            <td class="pr10 search-table-70">
                                            所属行业:
            </td>
            <td >
				<select  class="form-textbox" style="width: 200px;" name="bb">
					<option value="-1" selected>==请选择==</option>
					<c:forEach var="hangy" items="${hangylist}">
						<option value="${hangy.diccode}">${hangy.dicname}</option>
					</c:forEach>
				</select>
            </td>
          </tr> 
          <tr>
             <td class="pr10 search-table-70">
                                            签约状态:
            </td>
            <td >
           	   <select sclass="form-textbox" style="width: 200px;" name="cc" >
						<option value="-1" selected>==请选择==</option>
						<option value="0">未与银行签约</option>
						<option value="1">已与银行签约</option>
				</select>
            </td>
            <td class="pr10 search-table-70">
                                        所属省市:
            </td>
            <td>            	 
        	     <select class="form-textbox" style="width: 93px;" onchange="changForCity(this.value)" name="dd">
        	            <option value="-1">==请选择==</option>
						<c:forEach var="province" items="${provincelist}">
							<option value="${province.regioncode}" >${province.regionname}</option>
						</c:forEach>
		           </select>
        	       <select id="city" class="form-textbox" style="width: 93px;" name="ee" >
        	            <option value="-1" selected>==请选择==</option>
		            </select>
            </td>
           </tr> 
           <tr>
	         <td colspan="4"  align="left">
	             <input class="form-button-query form-button" type="button" value="查询" onclick="search();"/>
	             <input class="form-button-reset form-button"  type="reset" value="重置" />
	             <input class="form-button-query form-button" type="button" value="导出excel" onclick="exportexcel();"/>
	         </td>
           </tr>    
  </table>
  </form>
  </div>
   <div id="tabs">
	<div id="#myTab">
	  <p></p>
	  <div style="margin-left:15px">
	  <table id="myTab" class="scroll" cellpadding="0" cellspacing="0" ></table> 
      <div id="pager13" class="scroll"></div>   
      <div id="message" class="scroll"></div>
      </div>
   </div> 
    </div>
    </div>
</div> 
</body>
</html>